package com.future.dao.mapper;

import com.future.dao.entity.StartNumberHandleDO;
import com.future.dao.entity.StartNumberHandleDOExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface StartNumberHandleDOMapper {
    @SelectProvider(type=StartNumberHandleDOSqlProvider.class, method="countByExample")
    int countByExample(StartNumberHandleDOExample example);

    @DeleteProvider(type=StartNumberHandleDOSqlProvider.class, method="deleteByExample")
    int deleteByExample(StartNumberHandleDOExample example);

    @Delete({
        "delete from tbl_start_number",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into tbl_start_number (start_number, value, ",
        "create_at)",
        "values (#{startNumber,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, ",
        "#{createAt,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(StartNumberHandleDO record);

    @InsertProvider(type=StartNumberHandleDOSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(StartNumberHandleDO record);

    @SelectProvider(type=StartNumberHandleDOSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="start_number", property="startNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="value", property="value", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_at", property="createAt", jdbcType=JdbcType.TIMESTAMP)
    })
    List<StartNumberHandleDO> selectByExample(StartNumberHandleDOExample example);

    @Select({
        "select",
        "id, start_number, value, create_at",
        "from tbl_start_number",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="start_number", property="startNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="value", property="value", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_at", property="createAt", jdbcType=JdbcType.TIMESTAMP)
    })
    StartNumberHandleDO selectByPrimaryKey(Integer id);

    @UpdateProvider(type=StartNumberHandleDOSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") StartNumberHandleDO record, @Param("example") StartNumberHandleDOExample example);

    @UpdateProvider(type=StartNumberHandleDOSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") StartNumberHandleDO record, @Param("example") StartNumberHandleDOExample example);

    @UpdateProvider(type=StartNumberHandleDOSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(StartNumberHandleDO record);

    @Update({
        "update tbl_start_number",
        "set start_number = #{startNumber,jdbcType=VARCHAR},",
          "value = #{value,jdbcType=VARCHAR},",
          "create_at = #{createAt,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(StartNumberHandleDO record);
}